package milkproduction.to;

public class OrderTO {
	private int orderNo;
	private String orderDate;
	private String orderer;
	private int quantity;
	private boolean deliveryState;

	public OrderTO(){}

	public OrderTO(int orderNo, String orderDate, String orderer, int quantity,
			boolean deliveryState) {
		super();
		this.orderNo = orderNo;
		this.orderDate = orderDate;
		this.orderer = orderer;
		this.quantity = quantity;
		this.deliveryState = deliveryState;
	}

	public int getOrderNo() {
		return orderNo;
	}

	public void setOrderNo(int orderNo) {
		this.orderNo = orderNo;
	}

	public String getOrderDate() {
		return orderDate;
	}

	public void setOrderDate(String orderDate) {
		this.orderDate = orderDate;
	}

	public String getOrderer() {
		return orderer;
	}

	public void setOrderer(String orderer) {
		this.orderer = orderer;
	}

	public int getQuantity() {
		return quantity;
	}

	public void setQuantity(int quantity) {
		this.quantity = quantity;
	}

	public boolean isDeliveryState() {
		return deliveryState;
	}

	public void setDeliveryState(boolean deliveryState) {
		this.deliveryState = deliveryState;
	}

	@Override
	public String toString() {
		return "OrderTO [orderNo=" + orderNo + ", orderDate=" + orderDate
				+ ", orderer=" + orderer + ", quantity=" + quantity
				+ ", deliveryState=" + deliveryState + "]";
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + (deliveryState ? 1231 : 1237);
		result = prime * result
				+ ((orderDate == null) ? 0 : orderDate.hashCode());
		result = prime * result + orderNo;
		result = prime * result + ((orderer == null) ? 0 : orderer.hashCode());
		result = prime * result + quantity;
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		OrderTO other = (OrderTO) obj;
		if (deliveryState != other.deliveryState)
			return false;
		if (orderDate == null) {
			if (other.orderDate != null)
				return false;
		} else if (!orderDate.equals(other.orderDate))
			return false;
		if (orderNo != other.orderNo)
			return false;
		if (orderer == null) {
			if (other.orderer != null)
				return false;
		} else if (!orderer.equals(other.orderer))
			return false;
		if (quantity != other.quantity)
			return false;
		return true;
	}

	
	
}
